package com.zxy.allSearcher.utils;

import com.zxy.allSearcher.common.ErrorCode;
import com.zxy.allSearcher.exception.ThrowUtils;
import org.apache.commons.lang3.StringUtils;

/**
 * 分页效验
 *
 * @author zxy
 * @since 2024/6/20
 **/
public class PageUtils {
    /**
     * 查询分页字段是否合法
     */
    public static void validPage(long current, long size) {
        ThrowUtils.throwIf(current <= 0 || size <= 0 || size > 20, ErrorCode.PARAMS_ERROR);
    }
}
